/************************************************************************
 * <br>
 * <ul>
 * <li>版权所有：唐山弘川科技有限公司 2009－2020</li>
 * <li>创建日期：2009-8-21</li>
 * <li>初始作者：刘川</li>
 * </ul>
 * <ul>
 * <b>修订历史</b>
 * <li>1、</li>
 * </ul>
 ***********************************************************************/
package com.hy.erp.inventory.pojo ;

import java.math.BigDecimal ;
import java.util.Date ;
import java.util.List ;

import javax.persistence.Basic ;
import javax.persistence.CascadeType ;
import javax.persistence.Column ;
import javax.persistence.Entity ;
import javax.persistence.FetchType ;
import javax.persistence.JoinColumn;
import javax.persistence.Lob ;
import javax.persistence.ManyToOne ;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany ;
import javax.persistence.OneToOne ;
import javax.persistence.Table ;
import javax.persistence.Temporal ;
import javax.persistence.TemporalType ;

import org.hibernate.annotations.Index ;
import org.hibernate.annotations.IndexColumn;

import com.hy.erp.inventory.dao.interfaces.IOrganisationDao;
//import com.hy.erp.inventory.pojo.LendOutBound.ILendOutBoundBill;
import com.hy.erp.inventory.pojo.interfaces.IContact;
import com.hy.erp.inventory.pojo.interfaces.IOrganisation;
import com.hy.erp.inventory.pojo.interfaces.IPerson;
import com.hy.mydesktop.shared.persistence.domain.gxt.MyBaseModel;

/**
 * 
 * <ul>
 * <li>开发作者：李冰</li>
 * <li>设计日期：2010-10-5；时间：上午09:28:33</li>
 * <li>类型名称：Organisation</li>
 * <li>设计目的：组织</li>
 * </ul>
 * <ul>
 * <b>修订编号：</b>
 * <li>修订日期：</li>
 * <li>修订作者：</li>
 * <li>修订原因：</li>
 * <li>修订内容：</li>
 * </ul>
 */
/*@ NamedQueries (
      	{
      		@ NamedQuery ( name = "selectOrganisationById" , query = "SELECT"
      															+ " organisation"
      															+ " FROM"
      															+ " com.pojo.Organisation organisation"
      															+    " WHERE"
      															+ " organisation.organizationType.name = '公司'"
      															

      		),@ NamedQuery ( name = "selectDepartMentById" , query = "SELECT"
					+ " organisation"
						+ " FROM"
						+ " com.pojo.Organisation organisation"
						+    " WHERE"
						+ " organisation.organizationType.name = '部门'"

),
      
      		@ NamedQuery ( name = "selectTeamById" , query = "SELECT"
					+ " organisation"
						+ " FROM"
						+ " com.pojo.Organisation organisation"
						+    " WHERE"
						+ " organisation.organizationType.name = '班组'"

)

      
      	} )*/
//@ Entity 
//@Table(name="t_organisation")
public class Organisation extends MyBaseModel //implements IPositonType
{
	private static final long	serialVersionUID	=
	                                                  - 5786932217534387546L ;
	


	/**
	 * 构造函数
	 */
	public Organisation ( )
	{
		
	}

	
	

	/**
	 * @see com.vsoft.libra.enterprise.architecture.common.lang.IName#getAbbreviation()
	 */
	@ Column ( name = "organisationNameAbbreviation" , length = 50 )
	@ Index ( name = "organisationNameAbbreviationIndex" )

	public String getAbbreviation ( )
	{
		return this.get(IOrganisation.ABBREVIATION) ;
	}

	/**
	 * @see com.vsoft.libra.enterprise.architecture.common.coding.IAncillaryCode#getAncillaryCode()
	 */
	@ Column ( name = "organisationAncillaryCode" , length = 20 )
	@ Index ( name = "organisationAncillaryCodeIndexIndex" )
	
	public String getAncillaryCode ( )
	{
		return  this.get(IOrganisation.ANCILLARYCODE) ;
	}

	

	/**
	 * @see com.vsoft.libra.enterprise.architecture.foundation.organisation.business.IOrganisation#getBusinessLicenceId()
	 */
	@ Column ( name = "organisationBusinessLicenceId" , length = 50 , unique = true )
	@ Index ( name = "organisationBusinessLicenceIdIndex" )
	
	public String getBusinessLicenceId ( )
	{
		 return this.get(IOrganisation.BUSINESSLICENCEID) ;
	}

	/**
	 * @see com.vsoft.libra.enterprise.architecture.foundation.organisation.business.IOrganisation#getCorporateRepresentative()
	 */
	@ Column ( name = "organisationCorporateRepresentative" , length = 50 )
	@ Index ( name = "organisationCorporateRepresentativeIndex" )
	
	public String getCorporateRepresentative ( )
	{
		 return this.get(IOrganisation.CORPORATEREPRESENTATIVE) ;
	}

	/**
	 * @see com.vsoft.libra.enterprise.architecture.common.lang.IDescription#getDescription()
	 */
	@ Column ( name = "organisationDescription" )
	@ Basic ( fetch = FetchType.LAZY )
	@ Lob
	
	public String getDescription ( )
	{
		 return this.get(IOrganisation.DESCRIPTION) ;
	}

	/**
	 * @see com.vsoft.libra.enterprise.architecture.foundation.organisation.business.IOrganisation#getDurationOfLicence()
	 */
	@Temporal(TemporalType.DATE)
	@ Column ( name = "organisationDdurationOfLicence" , length = 24 , precision = 20 , scale = 4 )
	
	public Date getDurationOfLicence ( )
	{
		return this.get(IOrganisation.DURATIONOFLICENCE) ;
	}
	public void setDurationOfLicence (
			Date durationOfLicence )
	{
	super.set(IOrganisation.DURATIONOFLICENCE,durationOfLicence) ;
	}
	/**
	 * @see com.vsoft.libra.enterprise.architecture.foundation.organisation.business.IOrganisation#getIsQuotedCompany()
	 */
	@ Column ( name = "organisationIsQuotedCompany" , length = 4 , nullable = true )
	
	public Boolean getIsQuotedCompany ( )
	{
		return  this.get(IOrganisation.ISQUOTEDCOMPANY) ;
	}

	/**
	 * @see com.vsoft.libra.enterprise.architecture.foundation.organisation.business.IOrganisation#getLandTaxId()
	 */
	@ Column ( name = "organisationLandTaxId" , length = 50 )
	@ Index ( name = "organisationLandTaxIdIndex" )
	
	public String getLandTaxId ( )
	{
		return this.get(IOrganisation.LANDTAXID) ;
	}

	

	/**
	 * @see com.vsoft.libra.enterprise.architecture.common.lang.IName#getName()
	 */
	@ Column ( name = "organisationName" , length = 100 , nullable = false )
	@ Index ( name = "organisationNameIndex" )
	
	public String getName ( )
	{
		return this.get(IOrganisation.NAME) ;
	}

	/**
	 * @see com.vsoft.libra.enterprise.architecture.common.coding.INamedCode#getNamedCode()
	 */
	@ Column ( name = "organisationNamedCode" , length = 50 )
	@ Index ( name = "organisationNamedCodeIndex" )
	
	public String getNamedCode ( )
	{
		return this.get(IOrganisation.NAMECODE) ;
	}

	/**
	 * @see com.vsoft.libra.enterprise.architecture.foundation.organisation.business.IOrganisation#getNationalTaxId()
	 */
	@ Column ( name = "organisationNationalTaxId" , length = 50 )
	@ Index ( name = "organisationNationalTaxIdIndex" )
	
	public String getNationalTaxId ( )
	{
		return this.get(IOrganisation.NATIONALTAXID) ;
	}

	/**
	 * @see com.vsoft.libra.enterprise.architecture.foundation.organisation.business.IOrganisation#getQuotedDate()
	 */
	@ Column ( name = "organisationQuotedDate" , length = 50 )
	@ Temporal ( TemporalType.DATE )
	
	public Date getQuotedDate ( )
	{
		return this.get(IOrganisation.QUOTEDDATE) ;
	}

	
	/**
	 * @see com.vsoft.libra.enterprise.architecture.foundation.organisation.business.IOrganisation#getRegisterDate()
	 */
	@ Column ( name = "organisationRegisterDate" , length = 50 )
	@ Temporal ( TemporalType.DATE )
	
	public Date getRegisterDate ( )
	{
		return this.get(IOrganisation.REGISTERDATE) ;
	}

	/**
	 * @see com.vsoft.libra.enterprise.architecture.foundation.organisation.business.IOrganisation#getRegisteredCapital()
	 */
	@ Column ( name = "organisationRegisteredCapital" , length = 24 , precision = 20 , scale = 4 )

	public Double getRegisteredCapital ( )
	{
		return this.get(IOrganisation.REGISTEREDCAPITAL) ;
	}
	
	public void setRegisteredCapital (
			Double registeredCapital )
	{
	super.set(IOrganisation.REGISTEREDCAPITAL,registeredCapital) ;
	}
   
    
    /**
     * 企业成立日期
     */
 
    @ Column ( name = "createDate" , length = 24 , precision = 20 , scale = 4 )

	public Date getCreateDate ( )
	{
		return this.get(IOrganisation.CREATE_DATE) ;
	}
    
    
    public void setCreateDate (
	                              Date createDate )
	{
		super.set(IOrganisation.CREATE_DATE,createDate) ;
	}
    
    
    @ Column ( name = "bookNumber" , length = 24 , precision = 20 , scale = 4 )

	public String getBookNumber ( )
	{
		return this.get(IOrganisation.BOOKS_NUMBER) ;
	}
    
    
    public void setBookNumber (
	                              String bookNumber )
	{
		super.set(IOrganisation.BOOKS_NUMBER,bookNumber) ;
	}
	
    @ Column ( name = "scopeOfBusiness" , length = 24 , precision = 20 , scale = 4 )

	public String getScopeOfBusiness ( )
	{
		return this.get(IOrganisation.SCOPE_OF_BUSINESS) ;
	}
    
    
    public void setScopeOfBusiness (
	                              String scopeOfBusiness )
	{
		super.set(IOrganisation.SCOPE_OF_BUSINESS,scopeOfBusiness) ;
	}

	/**
	 * @see com.vsoft.libra.enterprise.architecture.common.lang.IName#setAbbreviation(java.lang.String)
	 */
	
	public void setAbbreviation (
	                              String abbreviation )
	{
		super.set(IOrganisation.ABBREVIATION,abbreviation) ;
	}

	/**
	 * @see com.vsoft.libra.enterprise.architecture.common.coding.IAncillaryCode#setAncillaryCode(java.lang.String)
	 */
	
	public void setAncillaryCode (
	                               String ancillaryCode )
	{
		super.set(IOrganisation.ANCILLARYCODE,ancillaryCode) ;
	}

	
	/**
	 * @see com.vsoft.libra.enterprise.architecture.foundation.organisation.business.IOrganisation#setBusinessLicenceId(java.lang.String)
	 */

	public void setBusinessLicenceId (
	                                       String businessLicenceId )
	{
		super.set(IOrganisation.BUSINESSLICENCEID,businessLicenceId) ;
	}

	/**
	 * @see com.vsoft.libra.enterprise.architecture.foundation.organisation.business.IOrganisation#setCorporateRepresentative(java.lang.String)
	 */
	
	public void setCorporateRepresentative (
	                                         String corporateRepresentative )
	{
		super.set(IOrganisation.CORPORATEREPRESENTATIVE,corporateRepresentative) ;
	}




	public void setDescription (
									String description )
	{
		super.set(IOrganisation.DESCRIPTION,description) ;
	}




	




	public void setIsQuotedCompany (
										Boolean isQuotedCompany )
	{
		super.set(IOrganisation.ISQUOTEDCOMPANY,isQuotedCompany) ;
	}




	public void setLandTaxId (
									String landTaxId )
	{
		super.set(IOrganisation.LANDTAXID,landTaxId) ;
	}




	




	public void setName (
							String name )
	{
		super.set(IOrganisation.NAME,name) ;
	}




	public void setNamedCode (
								String namedCode )
	{
		super.set(IOrganisation.NAMECODE,namedCode) ;
	}




	public void setNationalTaxId (
										String nationalTaxId )
	{
		super.set(IOrganisation.NATIONALTAXID,nationalTaxId) ;
	}




	public void setQuotedDate (
								Date quotedDate )
	{
		super.set(IOrganisation.QUOTEDDATE,quotedDate) ;
	}




	public void setRegisterDate (
									Date registerDate )
	{
		super.set(IOrganisation.REGISTERDATE,registerDate) ;
	}




	





	@OneToMany(targetEntity=Contact.class,cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	@JoinColumn(name="Organisation_identifier")
	@IndexColumn(name="list_index")
	public List < Contact > getContact ( )
	{
	return this.get(IOrganisation.CONTACT) ;
	}




	public void setContact (
							List < Contact> contact )
	{
		super.set(IOrganisation.CONTACT, contact);
	}


	@OneToMany(targetEntity=Industry.class,cascade=CascadeType.ALL)
	@JoinColumn(name="Organisation_identifier")
	@IndexColumn(name="list_index")

	public List<Industry> getIndustry ( )
	{
		return this.get(IOrganisation.INDUSTRY) ;
	}




	public void setIndustry (
								List<Industry>  industry )
	{
		super.set(IOrganisation.INDUSTRY, industry);
	}



//	@OneToOne(targetEntity=EconomicType.class,fetch=FetchType.LAZY)
	@OneToOne(targetEntity=EconomicType.class,fetch=FetchType.EAGER,cascade=CascadeType.ALL)
	public  EconomicType  getEconomicType ( )
	{
		return this.get(IOrganisation.ECONOMICTYPE) ;
	}




	public void setEconomicType (
									EconomicType economicType )
	{
		super.set(IOrganisation.ECONOMICTYPE, economicType);
	}



	@OneToOne(targetEntity=Person.class,fetch=FetchType.LAZY)
	public Person getLawPerson ( )
	{
		return this.get(IOrganisation.LAWPERSON) ;
	}




	public void setLawPerson (
								Person lawPerson )
	{
		super.set(IOrganisation.LAWPERSON, lawPerson);
	}



	@ Column ( name = "contanctAddress" , length = 50 )
	@ Index ( name = "contanctAddressIndex" )
	public String getContantAddress ( )
	{
		return this.get(IOrganisation.CONTANTADDRESS) ;
	}




	public void setContantAddress (
								String contanctAddress )
	{
		super.set(IOrganisation.CONTANTADDRESS, contanctAddress);
	}

//联系地址省
@OneToOne(targetEntity=Province.class,fetch=FetchType.LAZY)
public Province getContantProvince()
{
	return this.get ( IOrganisation.CONTANTPROVINCE );
}
public void setContantProvince(Province province)
{
	super.set ( IOrganisation.CONTANTPROVINCE , province );
}

//联系地址市
@OneToOne(targetEntity=City.class,fetch=FetchType.LAZY)
public City getContantCity()
{
	return this.get ( IOrganisation.CONTANTCITY );
}
public void setContantCity(City city)
{
	super.set ( IOrganisation.CONTANTCITY , city );
}

@ManyToOne(targetEntity=OrganizationType.class,fetch=FetchType.LAZY)
	public OrganizationType getOrganizationType ( )
	{
		return this.get(IOrganisation.ORGANIZATIONTYPE) ;
	}




	public void setOrganizationType (
										OrganizationType organizationType )
	{
		super.set(IOrganisation.ORGANIZATIONTYPE, organizationType);
	}



	@ Column ( name = "specificAddress" , length = 50 )
		@ Index ( name = "specificAddressIndex" )

	public String getSpecificAddress ( )
	{
		return this.get(IOrganisation.SPECIFICADDRESS) ;
	}




	public void setSpecificAddress (
										String specificAddress )
	{
		super.set(IOrganisation.SPECIFICADDRESS, specificAddress);
	}



	@OneToOne(targetEntity=Organisation.class,fetch=FetchType.LAZY)
	public Organisation getAboveOrganization ( )
	{
		return this.get(IOrganisation.ABOVEORGANIZATION) ;
	}




	public void setAboveOrganization (
											Organisation AboveOrganization )
	{
		super.set(IOrganisation.ABOVEORGANIZATION, AboveOrganization);
	}


@ManyToOne(targetEntity=Position.class,fetch=FetchType.LAZY)

	public Position getPrincipalPositon ( )
	{
		return this.get(IOrganisation.PRINCIPALPOSITON) ;
	}




	public void setPrincipalPositon (
										Position principalPositon )
	{
		super.set(IOrganisation.PRINCIPALPOSITON, principalPositon);
	}



	/*@OneToMany(targetEntity=Customer.class,cascade=CascadeType.ALL)
	public List < Customer > getCustomer ( )
	{
	return this.get(IOrganisation.CUSTOMER) ;
	}




	public void setCustomer (
							List < Customer > customer )
	{
		super.set(IOrganisation.CUSTOMER, customer);
	}*/
	@OneToMany(targetEntity=Supplier.class,cascade=CascadeType.ALL)
	public List < Supplier > getSupplier ( )
	{
	return this.get(IOrganisation.SUPPLIER) ;
	}




	public void setSupplier (
							List < Supplier> supplier )
	{
		super.set(IOrganisation.SUPPLIER, supplier);
	}

	

	@ Column ( name = "registerAddress" , length = 50 )
	@ Index ( name = "registerAddressIndex" )
	public Address getRegisterAddress ( )
	{
		return this.get(IOrganisation.REGISTERADDRESS) ;
	}
	
	
	
	
	public void setRegisterAddress (
										Address registerAddress )
	{
		super.set(IOrganisation.REGISTERADDRESS, registerAddress);
	}
	
	//注册地址省
	@OneToOne(targetEntity=Province.class,fetch=FetchType.LAZY)
	public Province getRegisterProvince()
	{
		return this.get ( IOrganisation.REGISTERPROVINCE );
	}
	public void setRegisterProvince(Province province)
	{
		super.set ( IOrganisation.REGISTERPROVINCE , province );
	}
	
	//注册地址市
	@OneToOne(targetEntity=City.class,fetch=FetchType.LAZY)
	public City getRegisterCity()
	{
		return this.get ( IOrganisation.REGISTERCITY );
	}
	public void setRegisterCity(City city)
	{
		super.set ( IOrganisation.REGISTERCITY , city );
	}

	//备注
	@Column(name="remark",unique=false,nullable=true,insertable=true,updatable=true)
	public String getRemark ( )
	{
		return this.get ( IOrganisation.REMARK ) ;
	}
	
	public void setRemark (
							String remark )
	{
		super.set ( IOrganisation.REMARK , remark );
	}
	
/*@ Column ( name = "organisationDdurationOfLicence" , length = 24 , precision = 20 , scale = 4 )
	
	public BigDecimal getDurationOfLicence ( )
	{
		return this.get(IOrganisation.DURATIONOFLICENCE) ;
	}
	public void setDurationOfLicence (
			BigDecimal durationOfLicence )
	{
	super.set(IOrganisation.DURATIONOFLICENCE,durationOfLicence) ;
	}*/
	/*
	*//**
	 * @see com.vsoft.libra.enterprise.architecture.foundation.organisation.business.IOrganisation#getLogo()
	 *//*
	@ Column ( name = "organisationLogo" )
	@ Basic ( fetch = FetchType.LAZY )
	@ Lob
	
	public byte [ ] getLogo ( )
	{
		return this.get(IOrganisation.LOGO) ;
	}
	public void setLogo (
			byte [ ] logo )
	{
	super.set(IOrganisation.LOGO,logo) ;
	
	
	}*/
	/**
	 * @see com.vsoft.libra.enterprise.architecture.foundation.organisation.business.IOrganisation#getRegisteredCapital()
	 *//*
	@ Column ( name = "organisationRegisteredCapital" , length = 24 , precision = 20 , scale = 4 )

	public BigDecimal getRegisteredCapital ( )
	{
		return this.get(IOrganisation.REGISTEREDCAPITAL) ;
	}
	
	public void setRegisteredCapital (
			BigDecimal registeredCapital )
	{
	super.set(IOrganisation.REGISTEREDCAPITAL,registeredCapital) ;
	}*/
	
}
